package com.lc.service.serviceImpl;
import com.lc.service.ITestService;
import com.lc.service.ITestServiceProvider;
import com.lc.utils.MyApplicationContext;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by lichao on 2017/5/23.
 */
@Service(value = "ITestService.bl")
public class TestServiceImplPlus implements ITestService {

    @Resource
    public ITestServiceProvider testService;

    @Override
    public List getData(Integer id) {
        List list  =  new ArrayList();
        list.add("This is PlusImpl ! method is getRedisData ,Field is " +id);
        return list;
    }

    @Override
    public List getRedisData(String key) {
        List list  =  new ArrayList();
        list.add("This is PlusImpl ! method is getRedisData ,Field is " +key);
        return list;
    }

    @Override
    public String getProviderData(String id) {
        testService = (ITestServiceProvider)MyApplicationContext.getBean("testService");
        return testService.TestMethod(id);
    }

    @Override
    public void run() {
        System.out.println("RUN ~~~~~~~~~~~~~~");
    }
}
